#include<bits/stdc++.h>
using namespace std;
#define int long long

// 可以不用ceil，v/(d+1) == ceil(1.0 * v / d)
int v[100005], w[100005];

signed main() {
	int n, m;
	cin >> n >> m;
	for (int i = 1; i < n; i++) {
		cin >> v[i];
	}
	for (int i = 1; i <= n; i++) {
		cin >> w[i];
	}

	int ans = 0, pre = 0x3f3f3f3f;	// 总花费，上次油价
	int goDistance = 0, leave = 0;	// 需要另买油的距离，剩余油可走距离
	for (int i = 1; i < n; i++) {
		pre = min(w[i], pre);
		goDistance = v[i] - leave;
		int buy = ceil(1.0 * goDistance / m);
		ans += pre * buy;
		leave = buy * m - goDistance;
//		cout << ans << " ";
	}
//	cout << endl;
	cout << ans;
	return 0;
}
